home *** CD-ROM | disk | FTP | other *** search
/ PC User 2002 April / Disc 2 / PCUSER0402D2.iso / software / utils / files / wincron.exe / data1.cab / Sample_Scripts / ftp_rdel.tg < prev    next >
Encoding:
Text File  |  2001-10-20  |  1.2 KB  |  43 lines

  1. ## ftp_rdel.tab
  2. # Put a file on the remore server
  3. # script assumes:
  4. # 1. There is a temp/foo directory on the remote server.
  5. # 2. the environment variables: USER.SERVER, USER.USERID, and USER.PASSWORD are set elsewhere,
  6. #    perhaps in the global (computer) environment or the local environment of WinCron via 
  7. #    Config.tg or AutoRun.tg. You could also set them here in this this script or hard-code the 
  8. #    values passed to -ftp connect.
  9.  
  10. # handle an FTP error
  11. {
  12.     -name ftp_rdel
  13.     -start 
  14.     -stop
  15.     -action -print connecting to remote ftp server
  16.     -action -onerror connect_fail
  17.     -action -ftp connect handle %USER.SERVER% 21 %USER.USERID% %USER.PASSWORD%
  18.     -action -print getting file from remote ftp server
  19.     -action -onerror general_failure
  20.     -action -ftp cd handle temp/foo
  21.     -action -ftp rdel handle *
  22.     -action -ftp close handle 
  23.     -action -print done!
  24. }
  25.  
  26. # connection failed
  27. {
  28.     -name connect_fail
  29.     -action -print FTP open connection failed with error:
  30.     -action -print %TG.LAST_ERROR%
  31.     -action -return abort
  32. }
  33.  
  34. # general failure
  35. {
  36.     -name general_failure
  37.     -action -print FTP general failure with error:
  38.     -action -print %TG.LAST_ERROR%
  39.     -action -print Closing connection.
  40.     -action -ftp close handle
  41.     -action -return abort
  42. }
  43.